#ifndef WORMS_H
#define WORMS_H

#include <cstdlib>
#include <iostream>


//types perso
typedef uint8_t		ui8;
typedef uint16_t	ui16;
typedef uint32_t	ui32;
typedef uint64_t	ui64;

typedef int8_t		si8;
typedef int16_t		si16;
typedef int32_t		si32;
typedef int64_t		si64;



#define M_PI 3.14159265358979323846264338327
#define EPSILON 0.0001

#define MAX(x,y) 	((x)>(y)?(x):(y))
#define MIN(x,y) 	((x)<(y)?(x):(y))
#define NOW() 		(cout<<clock()<<endl);

#define TSIZE(tab)	(sizeof(tab)/sizeof(*tab)) //taille d'un tableau statique
#define TORAD(x) 	(x*M_PI/180)

#define CARRE(i) 	((i)*(i))
#define CUBE(i) 	((i)*CARRE(i))

#ifdef DEBUG
//	#define dcout std::cout
    #define DEBUGMODE true
	#define MARK 			{std::cout<<"MARK ("<<__FILE__<<":"<<__LINE__<<")"<<std::endl;}
    #define fail(s) 		{std::cerr<<"FAIL IN ["<<__FILE__<<":"<<__LINE__<<"] ("<<s<<")."<<std::endl; exit(-1);}
    #define assert(b,s)		if(!(b)){std::cerr<<"ASSERT "; fail(s);}

#else
//	#define dcout \/\/
    #define DEBUGMODE false
	#define MARK
    #define fail(s)
    #define assert(b,s)

#endif

#endif // WORMS_H
